GOOGLE_LIBGEP_SITE=repo://vendor/google/libgep
GOOGLE_LIBGEP_INSTALL_STAGING=YES
GOOGLE_LIBGEP_DEPENDENCIES=protobuf

HOST_GOOGLE_LIBGEP_INSTALL=YES
HOST_GOOGLE_LIBGEP_DEPENDENCIES=host-googletest host-protobuf

define GOOGLE_LIBGEP_BUILD_CMDS
	CROSS_PREFIX=$(TARGET_CROSS) \
	HOSTDIR=$(HOST_DIR) \
	$(MAKE) -C $(@D)
endef

define GOOGLE_LIBGEP_INSTALL_STAGING_CMDS
	DESTDIR=$(STAGING_DIR) \
	$(MAKE) -C $(@D) install
endef

define HOST_GOOGLE_LIBGEP_BUILD_CMDS
	LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib:$(HOST_DIR)/lib:$(LD_LIBRARY_PATH) \
	HOSTDIR=$(HOST_DIR) \
	$(MAKE) -C $(@D)
endef

define HOST_GOOGLE_LIBGEP_INSTALL_CMDS
	DESTDIR=$(HOST_DIR) \
	$(MAKE) -C $(@D) install
endef

define HOST_GOOGLE_LIBGEP_TEST_CMDS
	LD_LIBRARY_PATH=$(HOST_DIR)/usr/lib:$(HOST_DIR)/lib:$(LD_LIBRARY_PATH) \
	HOSTDIR=$(HOST_DIR) \
	$(MAKE) -C $(@D) test
endef

$(eval $(call GENTARGETS))
$(eval $(call GENTARGETS,host))
